import type { pointForm, tagForm } from "@/api/type";
import { defineStore } from "pinia";
import { reactive, ref } from "vue";

export const usePointStore = defineStore("point", {
  state: () => {
    return {
      pointDate: reactive<pointForm[]>([]),
      tag: reactive<tagForm[]>([]),
    };
  },
  actions: {
    setPoint(newPoint: pointForm[]) {
      this.pointDate = newPoint;
    },
    setTag(newTag: tagForm[]) {
      this.tag = newTag;
    },
    removeData() {
      this.tag = [];
      this.pointDate = <pointForm[]>[];
    },
  },
  persist: true,
});
